package com.ggkt.common.utils.web;
import com.ggkt.common.utils.JsonUtil;

/**
 * 
 * @author ggkt
 */
public enum RestStatus {
    
    Error(-1, "系统异常"),
    Fail(0, "fail"),
    Success(20000, "操作成功"),
    ParamError(2, "参数异常"),
    SignError(3, "签名错误"),
    NoLogin(4, "没有登录"),
    NoAuth(5, "没有权限");

    private int status;
    
    private String msg;
    
    private RestStatus(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }
    
    public int status() {
        return status;
    }

    public String msg() {
        return msg;
    }

    public String toJson() {
        return JsonUtil.object2JsonStr(this);
    }
    
}
